<r:RibbonWindow x:Class="MimeCloud.AssetManagement.DigitalLibrary.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Window1" Background="AliceBlue" Height="439" Width="762" xmlns:r="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary" xmlns:Converters="clr-namespace:MimeCloud.AssetManagement.DigitalLibrary.Converters">
<r:RibbonWindow.Resources>
    
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
               
                            <ResourceDictionary 
                   Source="/RibbonControlsLibrary;component/Themes/Office2007Blue.xaml"/>
                  
            </ResourceDictionary.MergedDictionaries>
       <Converters:AssetListItemConverter x:Key="ThumbConvert"/> </ResourceDictionary>
    </r:RibbonWindow.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <r:Ribbon Title="MimeCloud (Desktop)">
            <r:Ribbon.Resources>
                <r:RibbonCommand x:Key="OpenByIdCommand"
                             x:Name="OpenByIdCommand"
                             CanExecute="OpenByIdCommand_CanExecute"
                             Executed="OpenByIdCommand_Executed"
                             LabelTitle="Open By Id" LargeImageSource="/MimeCloud.AssetManagement.DigitalLibrary;component/Images/addwin.ico" />
              <r:RibbonCommand x:Key="NewAsset" x:Name="NewAsset"
                             LabelTitle="Blank Asset"
                               Executed="NewAsset_Executed"
                             LabelDescription="Close the application."
                             LargeImageSource="Images/applicationicon.png"
                             />
                <r:RibbonCommand x:Key="NewImageContent"
                             LabelTitle="Image"
                               Executed="NewImageContent_Executed"
                             LabelDescription="Insert an image in to this asset"
                             LargeImageSource="Images/applicationicon.png"
                             />
                <r:RibbonCommand x:Key="NewVideoContent"
                             LabelTitle="Video"
                               Executed="NewVideoContent_Executed"
                             LabelDescription="Insert a video in to this asset"
                             LargeImageSource="Images/videoicon.png"
                             />
                <r:RibbonCommand x:Key="SaveCommand"
                             LabelTitle="Save"
                             LabelDescription="Save details"
                             LargeImageSource="Images/copy.ico"
                             />
                <r:RibbonCommand x:Key="UploadCommand" x:Name="UploadCommand"
                             LabelTitle="Save &amp; Upload"
                             LabelDescription="Save details and upload files"
                             LargeImageSource="Images/Publish.ico"
                                 CanExecute="UploadCommand_CanExecute"
                                 Executed="UploadCommand_Executed"
                             />
                <r:RibbonCommand x:Key="LatestCommand" x:Name="LatestCommand"
                             LabelTitle="View Latest"
                             LabelDescription="Save details and upload files"
                             LargeImageSource="Images/Refresh.ico"
                                 CanExecute="LatestCommand_CanExecute"
                                 Executed="LatestCommand_Executed"
                             />
                <r:RibbonCommand x:Key="FindCommand"
                             LabelTitle="Find"
                             LabelDescription="Save details and upload files"
                             LargeImageSource="Images/Search.ico"
                             />
                <r:RibbonCommand x:Key="CloseSelectedAssetCommand" x:Name="CloseSelectedAssetCommand"
                             LabelTitle="Close current asset"
                             LabelDescription="Save details and upload files"
                                 CanExecute="CloseSelectedAssetCommand_CanExecute"
                                 Executed="CloseSelectedAssetCommand_Executed"
                             LargeImageSource="Images/Refresh.ico"
                             />
                <r:RibbonCommand x:Key="ApplicationButton"
                             LabelTitle="Application Button"
                             LabelDescription="Close the application."
                             LargeImageSource="Images/applicationicon.png"
                             />
                
                
                <r:RibbonCommand x:Key="NewContentType"
                             LabelTitle="New"
                             LabelDescription="Save details and upload files"
                             LargeImageSource="Images/add-file-48x48.png"
                                 Executed="NewContentType_Executed"
                                 CanExecute="NewContentType_CanExecute"
                             />
                <r:RibbonCommand x:Key="EditContentType"
                             LabelTitle="Edit"
                                 
                             LabelDescription="Save details and upload files"
                             LargeImageSource="Images/add-file-48x48.png"
                             />
                <r:RibbonCommand x:Key="NewMimeType"
                             LabelTitle="New"
                             LabelDescription="Save details and upload files"
                             LargeImageSource="Images/add-file-48x48.png"
                                 Executed="NewMimeType_Executed"
                                 CanExecute="NewContentType_CanExecute"
                             />
                <r:RibbonCommand x:Key="EditMimeType"
                             LabelTitle="Edit"
                                 
                             LabelDescription="Save details and upload files"
                             LargeImageSource="Images/add-file-48x48.png"
                             />
                <r:RibbonCommand x:Key="ViewDebug" x:Name="ViewDebug"
                             LabelTitle="View Debug"
                             LabelDescription="Save details and upload files"
                             LargeImageSource="Images/add-file-48x48.png"
                                 CanExecute="ViewDebug_CanExecute"
                                 Executed="ViewDebug_Executed"
                             />
                <r:RibbonCommand x:Key="Group_Home_New"
                                 LabelTitle="New" />
                <r:RibbonCommand x:Key="Content_New"
                                 LabelTitle="New" />
                <r:RibbonCommand x:Key="Group_Home_Open"
                                 LabelTitle="Open Assets" />
                <r:RibbonCommand x:Key="Group_Home_Save"
                                 LabelTitle="Saving" />
                <r:RibbonCommand x:Key="Group_Home_Search"
                                 LabelTitle="Searching" />
                <r:RibbonCommand x:Key="Group_Home_Manage"
                                 LabelTitle="Manage" />
                <r:RibbonCommand x:Key="Group_Admin_ContentType"
                                 LabelTitle="Content Types" />
                <r:RibbonCommand x:Key="Group_Admin_MimeType"
                                 LabelTitle="MIME Types" />
                <r:RibbonCommand x:Key="Group_Admin_Debug"
                                 LabelTitle="Debug" />
            </r:Ribbon.Resources>

            <r:Ribbon.ApplicationMenu>
                <r:RibbonApplicationMenu Command="{StaticResource ApplicationButton}"></r:RibbonApplicationMenu>
            </r:Ribbon.ApplicationMenu>
            <r:RibbonTab Label="Home">

                <r:RibbonGroup Command="{StaticResource Group_Home_New}" Name="Home_New">
                    <r:RibbonButton Command="{StaticResource NewAsset}" />
                </r:RibbonGroup>
                <r:RibbonGroup Command="{StaticResource Group_Home_Open}" Name="Home_Open">
                    <r:RibbonButton Command="{StaticResource OpenByIdCommand}" />
                </r:RibbonGroup>
                <r:RibbonGroup Command="{StaticResource Group_Home_Save}" Name="Home_Save">
                    <r:RibbonButton Command="{StaticResource SaveCommand}" />
                    <r:RibbonButton Command="{StaticResource UploadCommand}" />
                </r:RibbonGroup>
                <r:RibbonGroup Command="{StaticResource Group_Home_Search}" Name="Home_Search">
                    <r:RibbonButton Command="{StaticResource LatestCommand}" />
                    <r:RibbonButton Command="{StaticResource FindCommand}" />
                </r:RibbonGroup>
                <r:RibbonGroup Command="{StaticResource Group_Home_Manage}" Name="Home_Manage">
                    <r:RibbonButton Command="{StaticResource CloseSelectedAssetCommand}" />
                </r:RibbonGroup>
            </r:RibbonTab>
            
            <r:RibbonTab Label="Asset Content">
                <r:RibbonGroup Name="Content_New" Command="{StaticResource Content_New}">
                    <r:RibbonButton Command="{StaticResource NewImageContent}" />
                    <r:RibbonButton Command="{StaticResource NewVideoContent}" />
                </r:RibbonGroup> 
                
            </r:RibbonTab>
            <r:RibbonTab Label="Imaging"></r:RibbonTab>
            <r:RibbonTab Label="Video"></r:RibbonTab>
            <r:RibbonTab Label="Admin">
                <r:RibbonGroup Command="{StaticResource Group_Admin_ContentType}" Loaded="RibbonGroup_Loaded">
                    <r:RibbonButton Command="{StaticResource NewContentType}" />
                    <r:RibbonComboBox x:Name="listAssetContentType"  SelectionChanged="listAssetContentType_SelectionChanged">
             
                    </r:RibbonComboBox>
                    <r:RibbonButton Command="{StaticResource EditContentType}"  />
                </r:RibbonGroup>
                <r:RibbonGroup Command="{StaticResource Group_Admin_MimeType}">
                    <r:RibbonButton Command="{StaticResource NewMimeType}" />
                    <r:RibbonButton Command="{StaticResource EditMimeType}"  />
                </r:RibbonGroup>
                <r:RibbonGroup Command="{StaticResource Group_Admin_Debug}">
                    <r:RibbonButton Command="{StaticResource ViewDebug}" />
                </r:RibbonGroup>
                
            </r:RibbonTab>
            <r:RibbonTab Label="Preferences"></r:RibbonTab>
        </r:Ribbon>
        
        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="120"></ColumnDefinition>
                <ColumnDefinition Width="3"></ColumnDefinition>
                <ColumnDefinition></ColumnDefinition>    
            </Grid.ColumnDefinitions>
            
            
            
            <Grid x:Name="ContentGrid" Grid.Column="2">
            <!--Assets go here -->
            </Grid>

            <ListBox Grid.Column="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Name="usrOpenAssetList" SelectionChanged="usrOpenAssetList_SelectionChanged">
                <ItemsPanelTemplate>
                    <WrapPanel></WrapPanel>
                </ItemsPanelTemplate>
                <ListBox.Template>
                    <ControlTemplate>
                        <Grid>
                            <ScrollViewer>
                                <ItemsPresenter />
                            </ScrollViewer>
                        </Grid>
                    </ControlTemplate>
                </ListBox.Template>
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <Image Source="{Binding Converter={StaticResource ThumbConvert}, ConverterParameter=thumbimg}" Width="50" Height="50" />
                            <StackPanel Orientation="Vertical">
                                <TextBlock x:Name="ItemDisplayName" Text="{Binding Converter={StaticResource ThumbConvert}, ConverterParameter=filename}" />
                                <TextBlock x:Name="ItemDisplayContent" Text="{Binding Converter={StaticResource ThumbConvert}, ConverterParameter=childdetail}" />
                            </StackPanel>
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>

            <GridSplitter Grid.Column="1" 
                Height="Auto" Width="Auto" HorizontalAlignment="Stretch" 
                VerticalAlignment="Stretch" />
            
        </Grid>
        
        
    </Grid>
</r:RibbonWindow>
